import { createRouter, createWebHashHistory } from 'vue-router'

import layout from "../layout/index.vue";

const routes = [
  // 首页
  {
    path: '/',
    redirect: '/app/index',
    component: layout,
    // 二级路由
    children: [
      //主页
      {
        path: '/app/index',
        name: 'index',
        component: () => import('../views/Index')
      },
      // 产品展示
      {
        path: '/app/products',
        name: 'products',
        component: () => import('../views/Products')
      },
      {
        path: '/app/sq',
        name: 'sq',
        component: () => import('../views/Products/sq')
      },
      // 结束
      {
        path: '/app/contents',
        name: 'contents',
        component: () => import('../views/Contact')
      },
      // 新闻
      {
        path: '/app/news',
        name: '服务行业',
        component: () => import('../views/News')
      },
      {
        path: '/app/dt',
        name: '产品类别',
        component: () => import('../views/News/dt')
      },
      {
        path: '/app/pzcn',
        name: '品质承诺',
        component: () => import('../views/News/pzcn')
      },
      // 结束
      // 关于我们
      {
        path: '/app/about',
        name: 'about',
        component: () => import('../views/AboutUs')
      },
      {
        path: '/app/fzlc',
        name: 'fzlc',
        component: () => import('../views/AboutUs/pingzhi')
      },
      {
        path: '/app/wh',
        name: 'wh',
        component: () => import('../views/AboutUs/qiyewenhua')
      },
      {
        path: '/app/ys',
        name: 'ys',
        component: () => import('../views/AboutUs/youshi')
      },
      {
        path: '/app/zy',
        name: 'zy',
        component: () => import('../views/AboutUs/zhuyao')
      },
      // 结束
      {
        path: '/app/service',
        name: 'service',
        component: () => import('../views/Service')
      },
      {
        path: '/app/fw1',
        name: 'fw1',
        component: () => import('../views/Service/fw1')
      },
      {
        path: '/app/fw2',
        name: 'fw2',
        component: () => import('../views/Service/fw2')
      },
      {
        path: '/app/fw3',
        name: 'fw3',
        component: () => import('../views/Service/fw3')
      },
      {
        path: '/app/fw4',
        name: 'fw4',
        component: () => import('../views/Service/fw4')
      },
      {
        path: '/app/lj',
        name: 'lj',
        component: () => import('../views/Service/lj')
      },
      {
        path: '/app/dl',
        name: 'dl',
        component: () => import('../views/Service/dl')
      },
      // 品质
      {
        path: '/app/quality',
        name: 'quality',
        component: () => import('../views/Quality')
      },
      {
        path: '/app/lc',
        name: 'lc',
        component: () => import('../views/Quality/lc')
      },
      {
        path: '/app/gl',
        name: 'gl',
        component: () => import('../views/Quality/gl')
      },
      // 新闻详情
      {
        path: '/newsdetails',
        name: 'details',
        component: () => import('../views/News/details/index.vue')
      },
    ]
  },
  // 搜索页面
  {
    path: '/search',
    name: 'search',
    component: () => import('../views/Search/index.vue')
  },





  // 上传文件测试
  {
    path: '/test',
    name: '上传文件测试',
    component: () => import('../test.vue')
  },
  // 表单测试
  {
    path: '/formtest',
    name: '表单测试',
    component: () => import('../FormTest.vue')
  }

]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
